<!DOCTYPE html>
<html>
	<head>
		<!--
        	作者：刘开新
        	时间：2018-09-29
        	描述：
        -->
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#div1{width: 600px;height: 600px;border-style: solid;}
			#div2{width: 300px;height: 300px;border-style: solid;}
			#div3{width: 100px;height: 100px;border-style: solid;}
		</style>
	</head>
	<body>
		
		<div id="div1">
			<div id="div2">
				<div id="div3">
				</div>
			</div>
		</div>
	
		<script type="text/javascript">
			var color=["#FFEBCD","#00FFFF","#000000","	#54FF9F","	#4EEE94","royalblue","red"];
			for (var i=1;i<=3;i++) {
				var c=window.prompt("第"+i+"框：输入数字[0-6]就可以选择颜色","");
				var div=document.getElementById("div"+i).style.backgroundColor=color[c];	
			}
		</script>
	</body>
</html>